<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <script src="https://cdn.bootcdn.net/ajax/libs/axios/1.3.6/axios.js"></script>
  <div class="box"></div>
  <script>
    axios({
      // url: 'http://hmajax.itheima.net/api/province'
      url: 'http://hmajax.itheima.net/api/news'
    }).then(res => {
      // console.log(res.data.data, 2);
      const newArr = res.data.data.map(item => {
        return `<div>
          ${item.id}==
          <img src='${item.img}' />
          <h1>${item.title}</h1>
          <div>${item.time}</div>
          </div>`
      })
      console.log(newArr);//['<div>2</div>','<div>2</div>']
      document.querySelector('.box').innerHTML = newArr.join(' ')
    })
  </script>
</body>

</html>